package com.teziyou.commodity.web;

import java.util.List;
import java.util.Map;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.alibaba.fastjson.JSON;
import com.mytravel.platform.bean.DictionaryBean;
import com.teziyou.commodity.service.DictService;
import com.teziyou.commodity.service.SceneService;

@SuppressWarnings({"rawtypes", "unchecked"})
@RequestMapping("/adviced")
@Controller
public class AdvicedCategoryController extends BaseController {
	

	
	/**
	 * Logger for this class
	 */
	private static final Logger logger = Logger.getLogger(AdvicedCategoryController.class);
	
	
	@Autowired
	private DictService dictService;

	@Autowired
	private SceneService sceneService;
	
	@RequestMapping("/index")
	public String getAdvicedCategoryIndex(Map map) {
		
		//检查输入参数合法性，以后添加
		
		
		
		List<DictionaryBean> trees1 = dictService.getDictionaryList("0340");
		
		String sjTrees1 = JSON.toJSONString(trees1);
		logger.debug("getDictionaryList(0340)="+sjTrees1);
		
		
		List<DictionaryBean> trees3 = dictService.getDictionaryList("0241");	
		
		String sjTrees3 = JSON.toJSONString(trees3);
		logger.debug("getDictionaryList(0241)="+sjTrees3);	
		
		/////////////////////////Just for test in case of remote link broken
		
		
	//			String sjTrees1 = "[{\"descripiton\":\"\",\"dicDictionaryId\":0,\"dictionaryId\":2151,\"firstNumber\":0,\"isOK\":0,\"itemType\":\"0340\",\"itemValue\":0,\"name\":\"当季热卖\",\"orderNO\":0,\"secondNumber\":0,\"setDescripiton\":true,\"setDicDictionaryId\":true,\"setDictionaryId\":true,\"setFirstNumber\":false,\"setIsOK\":false,\"setItemType\":true,\"setItemValue\":false,\"setName\":true,\"setOrderNO\":true,\"setSecondNumber\":true},{\"descripiton\":\"\",\"dicDictionaryId\":0,\"dictionaryId\":2152,\"firstNumber\":0,\"isOK\":0,\"itemType\":\"0340\",\"itemValue\":0,\"name\":\"另类个性\",\"orderNO\":0,\"secondNumber\":0,\"setDescripiton\":true,\"setDicDictionaryId\":true,\"setDictionaryId\":true,\"setFirstNumber\":false,\"setIsOK\":false,\"setItemType\":true,\"setItemValue\":false,\"setName\":true,\"setOrderNO\":true,\"setSecondNumber\":true},{\"descripiton\":\"\",\"dicDictionaryId\":0,\"dictionaryId\":2154,\"firstNumber\":0,\"isOK\":0,\"itemType\":\"0340\",\"itemValue\":0,\"name\":\"运动健身\",\"orderNO\":0,\"secondNumber\":0,\"setDescripiton\":true,\"setDicDictionaryId\":true,\"setDictionaryId\":true,\"setFirstNumber\":false,\"setIsOK\":false,\"setItemType\":true,\"setItemValue\":false,\"setName\":true,\"setOrderNO\":true,\"setSecondNumber\":true},{\"descripiton\":\"\",\"dicDictionaryId\":0,\"dictionaryId\":2155,\"firstNumber\":0,\"isOK\":0,\"itemType\":\"0340\",\"itemValue\":0,\"name\":\"1元秒杀\",\"orderNO\":0,\"secondNumber\":0,\"setDescripiton\":true,\"setDicDictionaryId\":true,\"setDictionaryId\":true,\"setFirstNumber\":false,\"setIsOK\":false,\"setItemType\":true,\"setItemValue\":false,\"setName\":true,\"setOrderNO\":true,\"setSecondNumber\":true},{\"descripiton\":\"\",\"dicDictionaryId\":0,\"dictionaryId\":2156,\"firstNumber\":0,\"isOK\":0,\"itemType\":\"0340\",\"itemValue\":0,\"name\":\"年票通杀\",\"orderNO\":0,\"secondNumber\":0,\"setDescripiton\":true,\"setDicDictionaryId\":true,\"setDictionaryId\":true,\"setFirstNumber\":false,\"setIsOK\":false,\"setItemType\":true,\"setItemValue\":false,\"setName\":true,\"setOrderNO\":true,\"setSecondNumber\":true},{\"descripiton\":\"\",\"dicDictionaryId\":0,\"dictionaryId\":2157,\"firstNumber\":0,\"isOK\":0,\"itemType\":\"0340\",\"itemValue\":0,\"name\":\"境外精选\",\"orderNO\":0,\"secondNumber\":0,\"setDescripiton\":true,\"setDicDictionaryId\":true,\"setDictionaryId\":true,\"setFirstNumber\":false,\"setIsOK\":false,\"setItemType\":true,\"setItemValue\":false,\"setName\":true,\"setOrderNO\":true,\"setSecondNumber\":true}]";
		//String sjTrees3 ="[{\"descripiton\":\"\",\"dicDictionaryId\":0,\"dictionaryId\":2105,\"firstNumber\":0,\"isOK\":0,\"itemType\":\"0241\",\"itemValue\":0,\"name\":\"名胜古迹\",\"orderNO\":0,\"secondNumber\":0,\"setDescripiton\":true,\"setDicDictionaryId\":true,\"setDictionaryId\":true,\"setFirstNumber\":false,\"setIsOK\":false,\"setItemType\":true,\"setItemValue\":false,\"setName\":true,\"setOrderNO\":true,\"setSecondNumber\":true},{\"descripiton\":\"\",\"dicDictionaryId\":2133,\"dictionaryId\":2227,\"firstNumber\":0,\"isOK\":0,\"itemType\":\"0241\",\"itemValue\":0,\"name\":\"温泉\",\"orderNO\":0,\"secondNumber\":0,\"setDescripiton\":true,\"setDicDictionaryId\":true,\"setDictionaryId\":true,\"setFirstNumber\":false,\"setIsOK\":false,\"setItemType\":true,\"setItemValue\":false,\"setName\":true,\"setOrderNO\":true,\"setSecondNumber\":true},{\"descripiton\":\"\",\"dicDictionaryId\":2134,\"dictionaryId\":2231,\"firstNumber\":0,\"isOK\":0,\"itemType\":\"0241\",\"itemValue\":0,\"name\":\"滑雪\",\"orderNO\":0,\"secondNumber\":0,\"setDescripiton\":true,\"setDicDictionaryId\":true,\"setDictionaryId\":true,\"setFirstNumber\":false,\"setIsOK\":false,\"setItemType\":true,\"setItemValue\":false,\"setName\":true,\"setOrderNO\":true,\"setSecondNumber\":true},{\"descripiton\":\"\",\"dicDictionaryId\":2135,\"dictionaryId\":2233,\"firstNumber\":0,\"isOK\":0,\"itemType\":\"0241\",\"itemValue\":0,\"name\":\"演唱会\",\"orderNO\":0,\"secondNumber\":0,\"setDescripiton\":true,\"setDicDictionaryId\":true,\"setDictionaryId\":true,\"setFirstNumber\":false,\"setIsOK\":false,\"setItemType\":true,\"setItemValue\":false,\"setName\":true,\"setOrderNO\":true,\"setSecondNumber\":true},{\"descripiton\":\"\",\"dicDictionaryId\":2224,\"dictionaryId\":2235,\"firstNumber\":0,\"isOK\":0,\"itemType\":\"0241\",\"itemValue\":0,\"name\":\"海钓\",\"orderNO\":0,\"secondNumber\":0,\"setDescripiton\":true,\"setDicDictionaryId\":true,\"setDictionaryId\":true,\"setFirstNumber\":false,\"setIsOK\":false,\"setItemType\":true,\"setItemValue\":false,\"setName\":true,\"setOrderNO\":true,\"setSecondNumber\":true},{\"descripiton\":\"\",\"dicDictionaryId\":2223,\"dictionaryId\":2239,\"firstNumber\":0,\"isOK\":0,\"itemType\":\"0241\",\"itemValue\":0,\"name\":\"婚纱摄影\",\"orderNO\":0,\"secondNumber\":0,\"setDescripiton\":true,\"setDicDictionaryId\":true,\"setDictionaryId\":true,\"setFirstNumber\":false,\"setIsOK\":false,\"setItemType\":true,\"setItemValue\":false,\"setName\":true,\"setOrderNO\":true,\"setSecondNumber\":true},{\"descripiton\":\"\",\"dicDictionaryId\":2226,\"dictionaryId\":2240,\"firstNumber\":0,\"isOK\":0,\"itemType\":\"0241\",\"itemValue\":0,\"name\":\"滑翔飞行\",\"orderNO\":0,\"secondNumber\":0,\"setDescripiton\":true,\"setDicDictionaryId\":true,\"setDictionaryId\":true,\"setFirstNumber\":false,\"setIsOK\":false,\"setItemType\":true,\"setItemValue\":false,\"setName\":true,\"setOrderNO\":true,\"setSecondNumber\":true},{\"descripiton\":\"\",\"dicDictionaryId\":0,\"dictionaryId\":2110,\"firstNumber\":0,\"isOK\":0,\"itemType\":\"0241\",\"itemValue\":0,\"name\":\"古镇园林\",\"orderNO\":0,\"secondNumber\":0,\"setDescripiton\":true,\"setDicDictionaryId\":true,\"setDictionaryId\":true,\"setFirstNumber\":false,\"setIsOK\":false,\"setItemType\":true,\"setItemValue\":false,\"setName\":true,\"setOrderNO\":true,\"setSecondNumber\":true},{\"descripiton\":\"\",\"dicDictionaryId\":2133,\"dictionaryId\":2228,\"firstNumber\":0,\"isOK\":0,\"itemType\":\"0241\",\"itemValue\":0,\"name\":\"足疗\",\"orderNO\":0,\"secondNumber\":0,\"setDescripiton\":true,\"setDicDictionaryId\":true,\"setDictionaryId\":true,\"setFirstNumber\":false,\"setIsOK\":false,\"setItemType\":true,\"setItemValue\":false,\"setName\":true,\"setOrderNO\":true,\"setSecondNumber\":true},{\"descripiton\":\"\",\"dicDictionaryId\":2134,\"dictionaryId\":2232,\"firstNumber\":0,\"isOK\":0,\"itemType\":\"0241\",\"itemValue\":0,\"name\":\"单板乐园\",\"orderNO\":0,\"secondNumber\":0,\"setDescripiton\":true,\"setDicDictionaryId\":true,\"setDictionaryId\":true,\"setFirstNumber\":false,\"setIsOK\":false,\"setItemType\":true,\"setItemValue\":false,\"setName\":true,\"setOrderNO\":true,\"setSecondNumber\":true},{\"descripiton\":\"\",\"dicDictionaryId\":2135,\"dictionaryId\":2234,\"firstNumber\":0,\"isOK\":0,\"itemType\":\"0241\",\"itemValue\":0,\"name\":\"旅游演艺\",\"orderNO\":0,\"secondNumber\":0,\"setDescripiton\":true,\"setDicDictionaryId\":true,\"setDictionaryId\":true,\"setFirstNumber\":false,\"setIsOK\":false,\"setItemType\":true,\"setItemValue\":false,\"setName\":true,\"setOrderNO\":true,\"setSecondNumber\":true},{\"descripiton\":\"\",\"dicDictionaryId\":2224,\"dictionaryId\":2236,\"firstNumber\":0,\"isOK\":0,\"itemType\":\"0241\",\"itemValue\":0,\"name\":\"潜水\",\"orderNO\":0,\"secondNumber\":0,\"setDescripiton\":true,\"setDicDictionaryId\":true,\"setDictionaryId\":true,\"setFirstNumber\":false,\"setIsOK\":false,\"setItemType\":true,\"setItemValue\":false,\"setName\":true,\"setOrderNO\":true,\"setSecondNumber\":true},{\"descripiton\":\"\",\"dicDictionaryId\":2226,\"dictionaryId\":2241,\"firstNumber\":0,\"isOK\":0,\"itemType\":\"0241\",\"itemValue\":0,\"name\":\"蹦极\",\"orderNO\":0,\"secondNumber\":0,\"setDescripiton\":true,\"setDicDictionaryId\":true,\"setDictionaryId\":true,\"setFirstNumber\":false,\"setIsOK\":false,\"setItemType\":true,\"setItemValue\":false,\"setName\":true,\"setOrderNO\":true,\"setSecondNumber\":true},{\"descripiton\":\"\",\"dicDictionaryId\":0,\"dictionaryId\":2106,\"firstNumber\":0,\"isOK\":0,\"itemType\":\"0241\",\"itemValue\":0,\"name\":\"主题乐园\",\"orderNO\":0,\"secondNumber\":0,\"setDescripiton\":true,\"setDicDictionaryId\":true,\"setDictionaryId\":true,\"setFirstNumber\":false,\"setIsOK\":false,\"setItemType\":true,\"setItemValue\":false,\"setName\":true,\"setOrderNO\":true,\"setSecondNumber\":true},{\"descripiton\":\"\",\"dicDictionaryId\":2133,\"dictionaryId\":2229,\"firstNumber\":0,\"isOK\":0,\"itemType\":\"0241\",\"itemValue\":0,\"name\":\"按摩\",\"orderNO\":0,\"secondNumber\":0,\"setDescripiton\":true,\"setDicDictionaryId\":true,\"setDictionaryId\":true,\"setFirstNumber\":false,\"setIsOK\":false,\"setItemType\":true,\"setItemValue\":false,\"setName\":true,\"setOrderNO\":true,\"setSecondNumber\":true},{\"descripiton\":\"\",\"dicDictionaryId\":2224,\"dictionaryId\":2237,\"firstNumber\":0,\"isOK\":0,\"itemType\":\"0241\",\"itemValue\":0,\"name\":\"徒步野营\",\"orderNO\":0,\"secondNumber\":0,\"setDescripiton\":true,\"setDicDictionaryId\":true,\"setDictionaryId\":true,\"setFirstNumber\":false,\"setIsOK\":false,\"setItemType\":true,\"setItemValue\":false,\"setName\":true,\"setOrderNO\":true,\"setSecondNumber\":true},{\"descripiton\":\"\",\"dicDictionaryId\":0,\"dictionaryId\":2107,\"firstNumber\":0,\"isOK\":0,\"itemType\":\"0241\",\"itemValue\":0,\"name\":\"农家采摘\",\"orderNO\":0,\"secondNumber\":0,\"setDescripiton\":true,\"setDicDictionaryId\":true,\"setDictionaryId\":true,\"setFirstNumber\":false,\"setIsOK\":false,\"setItemType\":true,\"setItemValue\":false,\"setName\":true,\"setOrderNO\":true,\"setSecondNumber\":true},{\"descripiton\":\"\",\"dicDictionaryId\":2133,\"dictionaryId\":2230,\"firstNumber\":0,\"isOK\":0,\"itemType\":\"0241\",\"itemValue\":0,\"name\":\"SPA\",\"orderNO\":0,\"secondNumber\":0,\"setDescripiton\":true,\"setDicDictionaryId\":true,\"setDictionaryId\":true,\"setFirstNumber\":false,\"setIsOK\":false,\"setItemType\":true,\"setItemValue\":false,\"setName\":true,\"setOrderNO\":true,\"setSecondNumber\":true},{\"descripiton\":\"\",\"dicDictionaryId\":2224,\"dictionaryId\":2238,\"firstNumber\":0,\"isOK\":0,\"itemType\":\"0241\",\"itemValue\":0,\"name\":\"汽车越野\",\"orderNO\":0,\"secondNumber\":0,\"setDescripiton\":true,\"setDicDictionaryId\":true,\"setDictionaryId\":true,\"setFirstNumber\":false,\"setIsOK\":false,\"setItemType\":true,\"setItemValue\":false,\"setName\":true,\"setOrderNO\":true,\"setSecondNumber\":true},{\"descripiton\":\"\",\"dicDictionaryId\":0,\"dictionaryId\":2109,\"firstNumber\":0,\"isOK\":0,\"itemType\":\"0241\",\"itemValue\":0,\"name\":\"沾花惹草\",\"orderNO\":0,\"secondNumber\":0,\"setDescripiton\":true,\"setDicDictionaryId\":true,\"setDictionaryId\":true,\"setFirstNumber\":false,\"setIsOK\":false,\"setItemType\":true,\"setItemValue\":false,\"setName\":true,\"setOrderNO\":true,\"setSecondNumber\":true},{\"descripiton\":\"\",\"dicDictionaryId\":0,\"dictionaryId\":2108,\"firstNumber\":0,\"isOK\":0,\"itemType\":\"0241\",\"itemValue\":0,\"name\":\"城市娱乐\",\"orderNO\":0,\"secondNumber\":0,\"setDescripiton\":true,\"setDicDictionaryId\":true,\"setDictionaryId\":true,\"setFirstNumber\":false,\"setIsOK\":false,\"setItemType\":true,\"setItemValue\":false,\"setName\":true,\"setOrderNO\":true,\"setSecondNumber\":true},{\"descripiton\":\"\",\"dicDictionaryId\":0,\"dictionaryId\":2133,\"firstNumber\":0,\"isOK\":0,\"itemType\":\"0241\",\"itemValue\":0,\"name\":\"养生休闲\",\"orderNO\":0,\"secondNumber\":0,\"setDescripiton\":true,\"setDicDictionaryId\":true,\"setDictionaryId\":true,\"setFirstNumber\":false,\"setIsOK\":false,\"setItemType\":true,\"setItemValue\":false,\"setName\":true,\"setOrderNO\":true,\"setSecondNumber\":true},{\"descripiton\":\"\",\"dicDictionaryId\":0,\"dictionaryId\":2134,\"firstNumber\":0,\"isOK\":0,\"itemType\":\"0241\",\"itemValue\":0,\"name\":\"体育健身\",\"orderNO\":0,\"secondNumber\":0,\"setDescripiton\":true,\"setDicDictionaryId\":true,\"setDictionaryId\":true,\"setFirstNumber\":false,\"setIsOK\":false,\"setItemType\":true,\"setItemValue\":false,\"setName\":true,\"setOrderNO\":true,\"setSecondNumber\":true},{\"descripiton\":\"\",\"dicDictionaryId\":0,\"dictionaryId\":2135,\"firstNumber\":0,\"isOK\":0,\"itemType\":\"0241\",\"itemValue\":0,\"name\":\"演艺演出\",\"orderNO\":0,\"secondNumber\":0,\"setDescripiton\":true,\"setDicDictionaryId\":true,\"setDictionaryId\":true,\"setFirstNumber\":false,\"setIsOK\":false,\"setItemType\":true,\"setItemValue\":false,\"setName\":true,\"setOrderNO\":true,\"setSecondNumber\":true},{\"descripiton\":\"\",\"dicDictionaryId\":0,\"dictionaryId\":2136,\"firstNumber\":0,\"isOK\":0,\"itemType\":\"0241\",\"itemValue\":0,\"name\":\"儿童教育\",\"orderNO\":0,\"secondNumber\":0,\"setDescripiton\":true,\"setDicDictionaryId\":true,\"setDictionaryId\":true,\"setFirstNumber\":false,\"setIsOK\":false,\"setItemType\":true,\"setItemValue\":false,\"setName\":true,\"setOrderNO\":true,\"setSecondNumber\":true},{\"descripiton\":\"\",\"dicDictionaryId\":0,\"dictionaryId\":2137,\"firstNumber\":0,\"isOK\":0,\"itemType\":\"0241\",\"itemValue\":0,\"name\":\"拜佛祈福\",\"orderNO\":0,\"secondNumber\":0,\"setDescripiton\":true,\"setDicDictionaryId\":true,\"setDictionaryId\":true,\"setFirstNumber\":false,\"setIsOK\":false,\"setItemType\":true,\"setItemValue\":false,\"setName\":true,\"setOrderNO\":true,\"setSecondNumber\":true},{\"descripiton\":\"\",\"dicDictionaryId\":0,\"dictionaryId\":2224,\"firstNumber\":0,\"isOK\":0,\"itemType\":\"0241\",\"itemValue\":0,\"name\":\"另类个性\",\"orderNO\":0,\"secondNumber\":0,\"setDescripiton\":true,\"setDicDictionaryId\":true,\"setDictionaryId\":true,\"setFirstNumber\":false,\"setIsOK\":false,\"setItemType\":true,\"setItemValue\":false,\"setName\":true,\"setOrderNO\":true,\"setSecondNumber\":true},{\"descripiton\":\"\",\"dicDictionaryId\":0,\"dictionaryId\":2226,\"firstNumber\":0,\"isOK\":0,\"itemType\":\"0241\",\"itemValue\":0,\"name\":\"挑战极限\",\"orderNO\":0,\"secondNumber\":0,\"setDescripiton\":true,\"setDicDictionaryId\":true,\"setDictionaryId\":true,\"setFirstNumber\":false,\"setIsOK\":false,\"setItemType\":true,\"setItemValue\":false,\"setName\":true,\"setOrderNO\":true,\"setSecondNumber\":true},{\"descripiton\":\"\",\"dicDictionaryId\":0,\"dictionaryId\":2219,\"firstNumber\":0,\"isOK\":0,\"itemType\":\"0241\",\"itemValue\":0,\"name\":\"登山探险\",\"orderNO\":0,\"secondNumber\":0,\"setDescripiton\":true,\"setDicDictionaryId\":true,\"setDictionaryId\":true,\"setFirstNumber\":false,\"setIsOK\":false,\"setItemType\":true,\"setItemValue\":false,\"setName\":true,\"setOrderNO\":true,\"setSecondNumber\":true},{\"descripiton\":\"\",\"dicDictionaryId\":0,\"dictionaryId\":2220,\"firstNumber\":0,\"isOK\":0,\"itemType\":\"0241\",\"itemValue\":0,\"name\":\"影视基地\",\"orderNO\":0,\"secondNumber\":0,\"setDescripiton\":true,\"setDicDictionaryId\":true,\"setDictionaryId\":true,\"setFirstNumber\":false,\"setIsOK\":false,\"setItemType\":true,\"setItemValue\":false,\"setName\":true,\"setOrderNO\":true,\"setSecondNumber\":true},{\"descripiton\":\"\",\"dicDictionaryId\":0,\"dictionaryId\":2223,\"firstNumber\":0,\"isOK\":0,\"itemType\":\"0241\",\"itemValue\":0,\"name\":\"浪漫情怀\",\"orderNO\":0,\"secondNumber\":0,\"setDescripiton\":true,\"setDicDictionaryId\":true,\"setDictionaryId\":true,\"setFirstNumber\":false,\"setIsOK\":false,\"setItemType\":true,\"setItemValue\":false,\"setName\":true,\"setOrderNO\":true,\"setSecondNumber\":true}]";
		
		////////////////////////////////////////////////////////////
		map.put("trees1", sjTrees1);
		
		map.put("trees2", "");
		
		map.put("trees3", sjTrees3);
		
		return "advicedcategory/index";
	}
	
	@RequestMapping("/getAdvicedCategory")
	@ResponseBody
	public String getAdvicedCategoryByDictionaryid(@RequestParam(value="dicid",required=false) String dictionaryid)
	{
		logger.debug("getAdvicedCategoryByDictionaryid()  dictionaryid =" +dictionaryid);
			
		//String sjTrees1 ="[{\"adviced_letf_category_id\":1,\"dictionary_id\":2151,\"isOK\":1,\"list_order\":1,\"name1\":\"当季热卖\"},{\"adviced_letf_category_id\":2,\"dic_dictionary_id\":2227,\"dictionary_id\":2151,\"isOK\":1,\"list_order\":2,\"name1\":\"当季热卖\",\"name2\":\"温泉\"},{\"adviced_letf_category_id\":3,\"dic_dictionary_id\":2231,\"dictionary_id\":2151,\"isOK\":1,\"list_order\":3,\"name1\":\"当季热卖\",\"name2\":\"滑雪\"},{\"adviced_letf_category_id\":4,\"dictionary_id\":2152,\"isOK\":1,\"list_order\":4,\"name1\":\"另类个性\"},{\"adviced_letf_category_id\":5,\"dic_dictionary_id\":2235,\"dictionary_id\":2152,\"isOK\":1,\"list_order\":5,\"name1\":\"另类个性\",\"name2\":\"海钓\"},{\"adviced_letf_category_id\":6,\"dic_dictionary_id\":2240,\"dictionary_id\":2152,\"isOK\":1,\"list_order\":6,\"name1\":\"另类个性\",\"name2\":\"滑翔飞行\"},{\"adviced_letf_category_id\":7,\"dic_dictionary_id\":2241,\"dictionary_id\":2152,\"isOK\":1,\"list_order\":7,\"name1\":\"另类个性\",\"name2\":\"蹦极\"},{\"adviced_letf_category_id\":8,\"dictionary_id\":2154,\"isOK\":1,\"list_order\":8,\"name1\":\"运动健身\"},{\"adviced_letf_category_id\":9,\"dic_dictionary_id\":2237,\"dictionary_id\":2154,\"isOK\":1,\"list_order\":9,\"name1\":\"运动健身\",\"name2\":\"徒步野营\"},{\"adviced_letf_category_id\":10,\"dictionary_id\":2155,\"isOK\":1,\"list_order\":10,\"name1\":\"1元秒杀\"},{\"adviced_letf_category_id\":11,\"dictionary_id\":2156,\"isOK\":1,\"list_order\":11,\"name1\":\"年票通杀\"},{\"adviced_letf_category_id\":12,\"dictionary_id\":2157,\"isOK\":1,\"list_order\":12,\"name1\":\"境外精选\"}]";
		//return sjTrees1;
		
		String jsonString = sceneService.selectAdvicedCategorybyDictionaryid(dictionaryid);
		logger.debug("getAdvicedCategoryByDictionaryid jsonString = " +jsonString);
		
		
		return jsonString;
	}
	 
	@RequestMapping("/addAdvicedCategory")
	@ResponseBody
	public String addAdvicedCategory(@RequestParam(value="dictionaryid") String dictionaryid,@RequestParam(value="dicdictionaryid") String dicdictionaryid)
	{
		logger.debug("addAdvicedCategory() dictionaryid =" +dictionaryid+"  @@@@@@      dicdictionaryid =" +dicdictionaryid);
		
		//检查输入参数合法性，以后添加
		
		
		try {
			sceneService.addAdvicedCategory(Integer.parseInt(dictionaryid),Integer.parseInt(dicdictionaryid));
			return success("保存成功！！");
		} catch (Exception e) {
			e.printStackTrace();
			return fail("保存失败！！");
		}
	}

	@RequestMapping("/delAdvicedCategory")
	@ResponseBody
	public String delAdvicedCategory(@RequestParam(value="id") String id)
	{
		logger.debug("delAdvicedCategory id =" +id);
		
		//检查输入参数合法性，以后添加
		
		try {
			int iid = Integer.parseInt(id);
			sceneService.delAdvicedCategory(iid);
			return success("删除成功！！");
		} catch (Exception e) {
			e.printStackTrace();
			return fail("删除失败！！");
		}
	}
	
	public static void main(String[] args) {
		System.out.println( new AdvicedCategoryController().getAdvicedCategoryByDictionaryid("2152"));
	}
	
}
